﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Core;

namespace XiaoweiUWP.Helper
{
    public class Run
    {
        public static async Task Invoke(CoreDispatcher d, DispatchedHandler h)
        {
            if (d != null && !d.HasThreadAccess)
            {
                await d.RunAsync(CoreDispatcherPriority.Normal, h);
            }
            else
            {
                h();
            }
        }
    }
}
